var api = require('../../utils/api.js');
var app = getApp();
Page({
    data: {
        tophe:0
    },
    currentPageNumber: 1,
        onLoad() {
        var file=api.FIlE;
        var fileurl=api.FIlEURL;

        this.setData({
            bg:file,
            fileurl:fileurl
        })
     
    },
    onShow() {
        let jn = wx.getMenuButtonBoundingClientRect();

        console.log(jn);
        var tophe=jn.top+jn.height+80;
        this.setData({
            tophe:tophe+'px',
            over:jn.top
        })
        this.getbanner();
        this.getmeeting();
    },
    nexturl(ret){
        console.log(ret);
        var link=ret.currentTarget.dataset.link;
        wx.navigateTo({
          url:link
        })
    },
    seeall(){
        wx.switchTab({
        url: '/pages/qiandao/index',
        })
    },

    previewImage(e) {
        wx.previewImage({
            current: '', // 当前显示图片的http链接
            urls: [e.currentTarget.dataset.previewUrl] // 需要预览的图片http链接列表
        });

    },
    onShareAppMessage() {
        return {
            title: '科技技术协会~~',
            path: '/pages/index/index'
        }
    },

    getbanner(){
        var that=this;
        api.post({
            url: 'index/getbanner',
            data: {},
            success: data => {
               that.setData({
                   banner:data.data
               })
            },
        });
    },
    getmeeting(){
        var that=this;
        api.post({
            url: 'meeting/gettodaymeeting',
            data: {},
            success: data => {
                that.setData({
                    meeting:data.data
                })
            },
        });
    },


});
